------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/tg2778/Dropbox/0_Reviews_RnRs/072022_JOP_Roads/v3_JOP/Replication - Roads/4_Log/7_PMGSY.log
  log type:  text
 opened on:  20 Jan 2023, 16:01:36

. 
. use "1_Data/pmgsycensuscombined2.dta", clear
(Written by R.              )

. 
. egen statedistrict = group (pc01_state_id pc01_district_id )

. 
. **generate population variables
. gen percentscstpop = (pc01_vd_st_p+ pc01_vd_sc_p)*100/pc01_vd_t_p
(44,625 missing values generated)

. gen scstpop = pc01_vd_st_p+ pc01_vd_sc_p

. 
. *ppopulation between >=500 & <1000
. gen pop5001k = 0

. replace pop5001k = 1 if pc01_vd_t_p>=500 & pc01_vd_t_p<1000 & pc01_vd_t_p!=.
(145,127 real changes made)

. 
. *ppopulation between >=1000
. gen pop1k = 0

. replace pop1k = 1 if  pc01_vd_t_p>=1000 & pc01_vd_t_p!=.
(231,309 real changes made)

. 
. gen popvar = 0 if pc01_vd_t_p<=100 & pc01_vd_t_p!=.
(549,605 missing values generated)

. replace popvar = 1 if pc01_vd_t_p>100 & pc01_vd_t_p<=250 & pc01_vd_t_p!=.
(69,303 real changes made)

. replace popvar = 2 if pc01_vd_t_p>250 & pc01_vd_t_p<500 & pc01_vd_t_p!=.
(103,866 real changes made)

. replace popvar = 3 if pc01_vd_t_p>=500 & pc01_vd_t_p<1000 & pc01_vd_t_p!=.
(145,127 real changes made)

. replace popvar = 4 if pc01_vd_t_p>=1000 & pc01_vd_t_p!=.
(231,309 real changes made)

. 
. label define poplabel 0 "pop<=100" 1 "100<pop<=250" 2 "250<pop<500" 3 "500=<pop<1000" 4 "pop>=1000"

. label values popvar poplabel

. 
. *****************************************************************
. **ROAD VARIABLES
. **pmgsy road (includes all projects)
. replace pmgsyroad=0 if pmgsyroad==. 
(537,247 real changes made)

. 
. **only new roads
. gen pmgsynewroad = 0

. replace pmgsynewroad = 1 if imsupgradeconnect ==1
(67,657 real changes made)

. 
. **road in 2001 - is there road in baseline villages in 2001?
. gen pavedroad2001 = pc01_vd_app_pr
(36,290 missing values generated)

. 
. *****************************************************************
. **OTHER CENSUS VARIABLES THAT ARE USEFUL TO COMPARE 2001 AND 2011
. ****ELECTRICITY*****
. *pc01_vd_power_supl
. gen powerany2001 = 0 if pc01_vd_power_supl==0
(500,482 missing values generated)

. replace powerany2001 = 1 if pc01_vd_power_supl==1
(455,446 real changes made)

. 
. *pc11_vd_power_dom
. gen powerdom2011 = 0 if power_domes_status_2011==0 
(584,394 missing values generated)

. replace powerdom2011 = 1 if power_domes_status_2011==1
(428,759 real changes made)

. *****************
. *primary health centre 
. 
. *2001
. gen phc2001 = 0 if  pc01_vd_ph_cntr==0 & pc01_vd_ph_cntr!=.
(21,395 missing values generated)

. replace phc2001 = 1 if  pc01_vd_ph_cntr>0 & pc01_vd_ph_cntr!=.
(21,395 real changes made)

. 
. *2011
. gen phc2011 = 0 if  phc_num_2011==0 & phc_num_2011!=.
(140,858 missing values generated)

. replace phc2011 = 1 if  phc_num_2011>0 & phc_num_2011!=.
(21,859 real changes made)

. 
. *****************
. *post 
. *2001
. gen postoffice2001 = 0 if  pc01_vd_post_off==0 & pc01_vd_post_off!=.
(138,274 missing values generated)

. replace postoffice2001 = 1 if  pc01_vd_post_off>0 & pc01_vd_post_off!=.
(138,274 real changes made)

. 
. *2011
. gen postoffice2011 = 0 if po_status_2011==0
(169,292 missing values generated)

. replace postoffice2011 = 1 if po_status_2011==1
(50,622 real changes made)

. 
. *****************
. **primaryschool
. *2001
. gen pschool2001 = 0 if  pc01_vd_p_sch==0 & pc01_vd_p_sch!=.
(467,547 missing values generated)

. replace pschool2001 = 1 if  pc01_vd_p_sch>0 & pc01_vd_p_sch!=.
(467,547 real changes made)

. 
. *2011
. *in 2011 census primary nd private is separaate pc11_vd_p_sch_gov_status pc11_vd_p_sch_priv_status
. gen pschool2011 = 0 if pvt_p_num_2011==0 & govt_p_num_2011==0
(559,271 missing values generated)

. replace pschool2011 = 1 if (pvt_p_num_2011>0 | govt_p_num_2011>0) & pvt_p_num_2011!=. & govt_p_num_2011!=.
(409,104 real changes made)

. 
. *****************
. **secondary school 
. *2001
. gen sschool2001 = 0 if  pc01_vd_s_sch==0 & pc01_vd_s_sch!=.
(66,038 missing values generated)

. replace sschool2001 = 1 if  pc01_vd_s_sch>0 & pc01_vd_s_sch!=.
(66,038 real changes made)

. 
. *2011
. *pc11_vd_s_sch_gov_status pc11_vd_s_sch_priv_status
. gen sschool2011 = 0 if pvt_s_num_2011==0 & govt_s_num_2011==0
(213,952 missing values generated)

. replace sschool2011 = 1 if (pvt_s_num_2011>0 | govt_s_num_2011>0) & pvt_s_num_2011!=. & govt_s_num_2011!=.
(94,722 real changes made)

. 
. *****************
. **senior secondary school 
. *2001
. gen ssschool2001 = 0 if  pc01_vd_s_s_sch==0 & pc01_vd_s_s_sch!=.
(18,255 missing values generated)

. replace ssschool2001 = 1 if  pc01_vd_s_s_sch>0 & pc01_vd_s_s_sch!=.
(18,255 real changes made)

. 
. *2011
. *pc11_vd_s_s_sch_gov_status pc11_vd_s_s_sch_priv_status
. gen ssschool2011 = 0 if pvt_ss_num_2011==0 & govt_ss_num_2011==0
(158,486 missing values generated)

. replace ssschool2011 = 1 if (pvt_ss_num_2011>0 | govt_ss_num_2011>0) & pvt_ss_num_2011!=. & govt_ss_num_2011!=.
(39,324 real changes made)

. *****************
. 
. **bank
. *2001
. gen bank2001 = 0 if pc01_vd_bank_fac==0
(83,967 missing values generated)

. replace bank2001 = 1 if pc01_vd_bank_fac==1
(39,464 real changes made)

. gen commbank2001 = 0 if pc01_vd_comm_bank==0
(32,019 missing values generated)

. 
. *2011 (only commercial bank in 2011, not general bank variable)
. replace commbank2001=1 if pc01_vd_comm_bank>0 & pc01_vd_comm_bank!=.
(32,019 real changes made)

. gen commbank2011 =  cb_status_2011
(118,671 missing values generated)

. 
. gen bus2011 = 0 if pvt_bus_status_2011==0 & pub_bus_status_2011==0
(360,092 missing values generated)

. replace bus2011 = 1 if pvt_bus_status_2011==1| pub_bus_status_2011==1
(241,379 real changes made)

. 
. 
. 
. quietly: areg pc11r_hl_light_source_elec i.popvar pc01_vd_t_p percentscstpop pschool2001 sschool2001 ssschool2001 pc01_vd_dist_town i.pc01_vd_
> tap commbank2001 phc2001 pc01_vd_p_t_fac pc01_vd_comm_fac if statedummy2==1 & powerany2001==0, absorb(statedistrict) cluster(pcmod01_state)

. quietly: estimates store a_m1, title(OLS)

. 
. quietly: areg pc11r_hl_latrine_oth_open i.popvar pc01_vd_t_p percentscstpop pschool2001 sschool2001 ssschool2001 pc01_vd_dist_town i.pc01_vd_t
> ap commbank2001 phc2001 pc01_vd_p_t_fac pc01_vd_comm_fac if statedummy2==1, absorb(statedistrict) cluster(pcmod01_state)

. quietly: estimates store a_m2, title(OLS)

. 
. quietly: areg pmgsyroad i.popvar pc01_vd_t_p percentscstpop pschool2001 sschool2001 ssschool2001 pc01_vd_dist_town i.pc01_vd_tap commbank2001 
> phc2001 pc01_vd_p_t_fac pc01_vd_comm_fac if statedummy2==1, absorb(statedistrict) cluster(pcmod01_state)

. quietly: estimates store a_m3, title(OLS)

. 
. 
. *******************************************
. 
. 
. quietly: areg pschool2011 pmgsyroad pop5001k pop1k pschool2001 if statedummy2==1, absorb(statedistrict) cluster(pcmod01_state)

. quietly: estimates store b_m1, title(OLS)

. quietly estadd local fe "Yes"

. quietly estadd scalar rsqadj = e(r2_a)

. quietly estadd scalar Nobs = e(N)

. quietly estadd ysumm, me

. 
. quietly: areg sschool2011 pmgsyroad pop5001k pop1k sschool2001 if statedummy2==1, absorb(statedistrict) cluster(pcmod01_state)

. quietly: estimates store b_m2, title(OLS)

. quietly estadd local fe "Yes"

. quietly estadd scalar rsqadj = e(r2_a)

. quietly estadd scalar Nobs = e(N)

. quietly estadd ysumm, me

. 
. quietly: areg ssschool2011 pmgsyroad pop5001k pop1k ssschool2001 if statedummy2==1, absorb(statedistrict) cluster(pcmod01_state)

. quietly: estimates store b_m3, title(OLS)

. quietly estadd local fe "Yes"

. quietly estadd scalar rsqadj = e(r2_a)

. quietly estadd scalar Nobs = e(N)

. quietly estadd ysumm, me

. 
. quietly: areg powerdom2011 pmgsyroad pop5001k pop1k pc01_vd_power_dom if statedummy2==1, absorb(statedistrict) cluster(pcmod01_state)

. quietly: estimates store b_m4, title(OLS)

. quietly estadd local fe "Yes"

. quietly estadd scalar rsqadj = e(r2_a)

. quietly estadd scalar Nobs = e(N)

. quietly estadd ysumm, me

. 
. quietly: areg tsc_status_2011 pmgsyroad pop5001k pop1k if statedummy2==1, absorb(statedistrict) cluster(pcmod01_state)

. quietly: estimates store b_m5, title(OLS)

. quietly estadd local fe "Yes"

. quietly estadd scalar rsqadj = e(r2_a)

. quietly estadd scalar Nobs = e(N)

. quietly estadd ysumm, me

. 
. quietly: areg phc2011 pmgsyroad pop5001k pop1k phc2001 if statedummy2==1, absorb(statedistrict) cluster(pcmod01_state)

. quietly: estimates store b_m6, title(OLS)

. quietly estadd local fe "Yes"

. quietly estadd scalar rsqadj = e(r2_a)

. quietly estadd scalar Nobs = e(N)

. quietly estadd ysumm, me

. 
. quietly: areg postoffice2011 pmgsyroad pop5001k pop1k postoffice2001 if statedummy2==1, absorb(statedistrict) cluster(pcmod01_state)

. quietly: estimates store b_m7, title(OLS)

. quietly estadd local fe "Yes"

. quietly estadd scalar rsqadj = e(r2_a)

. quietly estadd scalar Nobs = e(N)

. quietly estadd ysumm, me

. 
. quietly: areg commbank2011 pmgsyroad pop5001k pop1k commbank2001 if statedummy2==1, absorb(statedistrict) cluster(pcmod01_state)

. quietly: estimates store b_m8, title(OLS)

. quietly estadd local fe "Yes"

. quietly estadd scalar rsqadj = e(r2_a)

. quietly estadd scalar Nobs = e(N)

. quietly estadd ysumm, me

. 
. quietly: areg bus2011 pmgsyroad if statedummy2==1 & pc01_vd_bs_fac==0, absorb(statedistrict) cluster(pcmod01_state)

. quietly: estimates store b_m9, title(OLS)

. quietly estadd local fe "Yes"

. quietly estadd scalar rsqadj = e(r2_a)

. quietly estadd scalar Nobs = e(N)

. quietly estadd ysumm, me

. 
. 
. *********************************************************************************
. 
. *cd "2_Tables/"
. 
. *E.4
. 
. *esttab a_m* using E4.tex, b(3) se(3) keep(*popvar*) varlabel(1.popvar "$100<$ pop $\leq250$" 2.popvar "$250<$ pop $<500$" 3.popvar "$500\leq$
>  pop $<1000$" 4.popvar "pop $\geq1000$") title("Population thresholds and provision of electricity, toilets and PMGSY") mtitles("Electricity" 
> "Open-defecation" "PMGSY") label drop(0.popvar) nonotes addnote("\makecell[tl]{\textit{Notes:} The unit of analysis is a census 2001 village i
> n the sample of states used in main specifications.\\Measures of electricity and sanitation are measured as \% households in the village with 
> the particular\\facility, while PMGSY road is a dummy which is 1 for villages that have benefited from PMGSY (new\\road/ bridge/ upgrade) betw
> een 2001-2011. All regressions control for baseline Census 2001 variables:\\village population, percentage of sc/st, whether village has acces
> s to primary school, secondary school,\\senior secondary school, distance to town, water supply, primary health centre, commercial banking,\\t
> elephone facility, communication facility. Each regression has a district fixed effect, state clustered\\standard errors, and constant that is
>  not reported. * p $<$ 0.05, ** p $<$ 0.01, *** p $<$ 0.001}") booktabs replace
. 
. 
. esttab a_m* using "2_Tables/E4.doc", b(3) se(3) keep(*popvar*) varlabel(1.popvar "100 < pop <= 250" 2.popvar "250 < pop < 500" 3.popvar "500 <
> = pop < 1000" 4.popvar "pop >= 1000") title("Population thresholds and provision of electricity, toilets and PMGSY") mtitles("Electricity" "Op
> en-defecation" "PMGSY") label drop(0.popvar) nonotes addnote("Notes: The unit of analysis is a census 2001 village in the sample of states use
> d in main specifications. Measures of electricity and sanitation are measured as % households in the village with the particular facility, whi
> le PMGSY road is a dummy which is 1 for villages that have benefited from PMGSY (new road/ bridge/ upgrade) between 2001-2011. All regressions
>  control for baseline Census 2001 variables: village population, percentage of sc/st, whether village has access to primary school, secondary 
> school, senior secondary school, distance to town, water supply, primary health centre, commercial banking, telephone facility, communication 
> facility. Each regression has a district fixed effect, state clustered standard errors, and constant that is not reported. * p < 0.05, ** p < 
> 0.01, *** p < 0.001}") rtf replace collabels(none)
(output written to 2_Tables/E4.doc)

. 
. 
. *E.5
. 
. *esttab b_m* using E5.tex, b(3) se(3) keep(pmgsyroad) varlabel(pmgsyroad "PMGSY village") title("Impact of receiving PMGSY benefits on other p
> ublic goods and services in 2011") mtitles("\makecell[c]{Primary\\schools}" "\makecell[c]{Sec\\schools}" "\makecell[c]{Sr. Sec\\schools}" "\ma
> kecell[c]{Domestic\\Electricity}" "\makecell[c]{Sanitation\\coverage}" "\makecell[c]{Primary health\\center}" "\makecell[c]{Post\\office}" "\m
> akecell[c]{Commercial\\bank}" "\makecell[c]{Bus\\service}") label  nonotes addnote("\makecell[tl]{\textit{Notes:} Table reports robust OLS est
> imates. The unit of analysis is a census 2001 village in the sample of states used in main specifications. PMGSY village\\is a dummy that is 1
>  if the village has received any PMGSY benefit and 0 otherwise. Each dependent variable is from the Census 2011. All regressions are\\estimate
> d on a subsample of villages where the particular service is unavailable at baseline. Standard errors are clustered at the state-level. Each r
> egression\\has a district fixed effect, state clustered standard errors, and constant that is not reported. * p $<$ 0.05, ** p $<$ 0.01, *** p
>  $<$ 0.001}") scalars("fe District FE" "Nobs N" "rsqadj Adj. $ R^2$" "ymean Mean") sfmt("%-20s" "%9.0f" "%9.3f" "%9.3f") noobs booktabs replac
> e
. 
. esttab b_m* using "2_Tables/E5.doc", cells(b(star fmt(3)) se(par fmt(3))) keep(pmgsyroad) varlabel(pmgsyroad "PMGSY village") title("Impact of
>  receiving PMGSY benefits on other public goods and services in 2011") mtitles("Primary schools" "Sec schools" "Sr. Sec schools" "Domestic Ele
> ctricity" "Sanitation coverage" "Primary health Cntr" "Post office" "Commercial bank" "Bus service") label  nonotes addnote("Notes: Table repo
> rts robust OLS estimates. The unit of analysis is a census 2001 village in the sample of states used in main specifications. PMGSY village is 
> a dummy that is 1 if the village has received any PMGSY benefit and 0 otherwise. Each dependent variable is from the Census 2011. All regressi
> ons are estimated on a subsample of villages where the particular service is unavailable at baseline. Standard errors are clustered at the sta
> te-level. Each regression has a district fixed effect, state clustered standard errors, and constant that is not reported. * p < 0.05, ** p < 
> 0.01, *** p < 0.001}") scalars("fe District FE" "Nobs N" "rsqadj Adj. R^2" "ymean Mean") sfmt("%-20s" "%9.0f" "%9.3f" "%9.3f") noobs rtf colla
> bels(none) replace varwidth(8) modelwidth(3 3 3 5 4 5 3 6 3) substitute("\fs20" "\fs16" "\fs24" "\fs20")
(output written to 2_Tables/E5.doc)

. log close
      name:  <unnamed>
       log:  /Users/tg2778/Dropbox/0_Reviews_RnRs/072022_JOP_Roads/v3_JOP/Replication - Roads/4_Log/7_PMGSY.log
  log type:  text
 closed on:  20 Jan 2023, 16:02:11
------------------------------------------------------------------------------------------------------------------------------------------------
